import request from '@/utils/request'

/**
 * @description: 登录
 * @param {mobile,password} data {用户登录数据}
 * @return {*}
 */

export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

/**
 * 获取个人信息
 * @returns
 */

export function getProfile() {
  return request({
    url: '/sys/profile',
    method: 'post'

  })
}

/**
 * @description: 获取用户头像
 * @param {*} id 用户id
 * @return {*}
 */
export function getUserDetailById(id) {
  return request({
    url: `/sys/user/${id}`
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
